﻿<ResourceDictionary 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:clr="clr-namespace:System;assembly=mscorlib">
    
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="MainTheme.xaml"/>
    </ResourceDictionary.MergedDictionaries>

    <!--TextBox Style-->
    <Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource TextControlStyle}">
        <Setter Property="Foreground" Value="{DynamicResource LabelForeground}"/>
        <Setter Property="Background" Value="{DynamicResource TextBoxBackground}"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Margin" Value="3"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TextBoxBase}">
                    <Border   Name="Border"
                              CornerRadius="5" 
                              Padding="3"
                              Background="{DynamicResource TextBoxBackground}"
                              BorderBrush="{DynamicResource TextBoxBackground}"
                              BorderThickness="1" 
                            
                              
                     >
                        <ScrollViewer Margin="0" x:Name="PART_ContentHost"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Cursor" Value="Hand"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <!--<Setter TargetName="Border" Property="Background" Value="Red"/>
                            <Setter TargetName="Border" Property="BorderBrush" Value="Red"/>
                            <Setter Property="Foreground" Value="Red"/>-->
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type TextBlock}" >
        <!--<Setter Property="Foreground" Value="{DynamicResource LabelForeground}"/>
        <Setter Property="Background" Value="{DynamicResource TextBoxBackground}"/>-->
        <Setter Property="Margin" Value="3"/>
   
    </Style>

    <Style TargetType="{x:Type TreeViewItem}" >
        <Setter Property="HorizontalContentAlignment" Value="{Binding Path=HorizontalContentAlignment, RelativeSource={RelativeSource AncestorLevel=1, AncestorType={x:Type ItemsControl}, Mode=FindAncestor}}"/>
        <Setter Property="VerticalContentAlignment" Value="{Binding Path=VerticalContentAlignment, RelativeSource={RelativeSource AncestorLevel=1, AncestorType={x:Type ItemsControl}, Mode=FindAncestor}}"/>
        <Setter Property="Margin" Value="2,2,2,2" />
        <Setter Property="Foreground" Value="{DynamicResource ListBoxItemForeground}"/>
        <Setter Property="Background" Value="{DynamicResource ListBoxItemBackground}"/>
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" Value="{DynamicResource ResourceKey=ListBoxItemHover}"/>
                <Setter Property="BorderBrush" Value="{DynamicResource ResourceKey=ListBoxItemHover}"/>
                <Setter Property="Foreground" Value="{DynamicResource ResourceKey=ListBoxItemForegroundInverse}"/>
            </Trigger>
            <Trigger Property="IsSelected" Value="True">
                <Setter Property="Background" Value="{DynamicResource ResourceKey=ListBoxItemSelected}"/>
                <Setter Property="BorderBrush" Value="{DynamicResource ResourceKey=ListBoxItemSelected}"/>
                <Setter Property="Foreground" Value="{DynamicResource ResourceKey=ListBoxItemForegroundInverse}"/>
            </Trigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsSelected" Value="True"/>
                    <Condition Property="Selector.IsSelectionActive" Value="False"/>
                </MultiTrigger.Conditions>
                <Setter Property="Background" Value="{DynamicResource ResourceKey=ListBoxItemSelected}"/>
                <Setter Property="BorderBrush" Value="{DynamicResource ResourceKey=ListBoxItemSelected}"/>
                <Setter Property="Foreground" Value="{DynamicResource ResourceKey=ListBoxItemForegroundInverse}"/>
            </MultiTrigger>
        </Style.Triggers>
    </Style>
    
    <Style TargetType="{x:Type TreeView}">
        <Setter Property="Background" Value="{DynamicResource ListBoxBackground}"/>
        <Setter Property="BorderThickness" Value="0"/>

    </Style>
    <Style TargetType="{x:Type ScrollViewer}">
      
        <Setter Property="Background" Value="{DynamicResource ListBoxBackground}"/>
        <Setter Property="Padding" Value="10"/>

    </Style>

</ResourceDictionary>